
# Now generate the configure file
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)


# Add the root of the binary distribution to the include directories !
# Do it in order to fetch config.h, however, we may generate config.h in the
# src directory.
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})

SET(libabf_SRCS
  src/abf_flat.c
  src/abf_format_dat.c
  src/abf_format_xml.c
)

SET(libabf_HEADERS
  src/abf.h
  src/abf_flat.h
  src/abf_types.h
  src/abf_format_dat.h
  src/abf_format_xml.h
)

INCLUDE_DIRECTORIES(${LIBABF_INCLUDE_DIR} ${LIBXML2_INCLUDE_PATH})

ADD_LIBRARY(abf SHARED ${libabf_SRCS})
TARGET_LINK_LIBRARIES(abf ${ZLIB_LIBRARIES} )
SET_TARGET_PROPERTIES(abf PROPERTIES
   VERSION ${ABF_VERSION}
   SOVERSION ${ABF_VERSION}
   CLEAN_DIRECT_OUTPUT 1
   OUTPUT_NAME abf)

INSTALL(TARGETS abf LIBRARY DESTINATION lib)
INSTALL(FILES ${libabf_HEADERS} DESTINATION include/abf)
